/*
一圆型游泳池如图所示，现在需在其周围建一圆型过道，并在其四周围上栅栏。栅栏价格为35元/米，过道造价为20元/平方米。
过道宽度为3米，游泳池半径由键盘输入。要求编程计算并输出过道和栅栏的造价。

图形描述：大圆嵌套小圆：
小圆在大圆中间，小圆为游泳池，大圆与小圆间隔为过道。
*/
#include <iostream>
using namespace std;
const float PI = 3.14259;
const float FencePrice = 35;
const float ConcretePrice = 20;

//定义圆的类
class Circle
{
private:
    float radius;

public:
    Circle(float r);
    float Cricumference() const;
    float Area() const;
};
//定义构造函数
Circle::Circle(float r)
{
    radius = r;
}
//定义计算周长的函数
float Circle::Cricumference() const
{
    return 2 * PI * radius;
}
//定义计算面积的函数
float Circle::Area() const
{
    return PI * radius * radius;
}

int main()
{
    float radius;
    float FenceCost, ConcreteCost;

    cout << "Enter the radius of the pool:" << endl;
    cin >> radius;
    //声明Circle对象
    Circle Pool(radius);
    Circle PoolRim(radius + 3);
    //计算栅栏造价
    FenceCost = PoolRim.Cricumference() * FencePrice;
    cout << "Fencing Cost is " << FenceCost << endl;
    //计算过道造价
    ConcreteCost = (PoolRim.Area() - Pool.Area()) * ConcretePrice;
    cout << "Concrete Cost is " << ConcreteCost << endl;
    system("pause");
    return 0;
}